package com.oauth.components.client.ui.windows;

import java.util.Iterator;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;

public class CanvasWindow extends Composite implements HasWidgets {

	private static WindowUiBinder uiBinder = GWT.create(WindowUiBinder.class);

	interface WindowUiBinder extends UiBinder<Widget, CanvasWindow> {
	}

	protected static String DEFAULT_WINDOW_TITLE = "Window";

	/*
	 * @UiField HorizontalPanel titlePanel;
	 * 
	 * @UiField Label title;
	 */

	@UiField
	FlowPanel contentPanel;

	public CanvasWindow() {
		initWidget(uiBinder.createAndBindUi(this));
		/*
		 * title.setText(DEFAULT_WINDOW_TITLE); titlePanel
		 * .setCellHorizontalAlignment(title, VerticalPanel.ALIGN_CENTER);
		 */
	}

	/*
	 * public void setTitle(String pTitle) { title.setText(pTitle); }
	 */
	@Override
	public void add(Widget pWidget) {
		contentPanel.add(pWidget);
	}

	@Override
	public void clear() {
		contentPanel.clear();
	}

	@Override
	public Iterator<Widget> iterator() {
		return contentPanel.iterator();
	}

	@Override
	public boolean remove(Widget pWidget) {
		return contentPanel.remove(pWidget);
	}

}
